//strlen  sizeof
#include<stdio.h>
#include<string.h>

//int main()
//{
//	int a = 0;
//	printf("%zd\n", sizeof(a)); //4
//	printf("%zd\n", sizeof(20)); //4
//	return 0;
//}

//int main()
//{
//	int arr[3] = { 0,1,2 };
//	printf("%zd\n", sizeof(arr)); //12 
//	printf("%zd\n", sizeof(arr[0])); //4
//	return 0;
//}

//int main()
//{
//	int arr[5] = { 1,2,3,4,5 };
//	printf("%zd", strlen(arr));  //1
//	return 0;
//}


//数组名是数组首元素的地址
//但是有2个例外：
//1. sizeof(数组名)
//2. &数组名

//int main()
//{
//	int a[] = { 1,2,3,4 };
//	printf("%d\n", sizeof(a)); //16
//	printf("%d\n", sizeof(a + 0)); //4/8
//	printf("%d\n", sizeof(*a));  //4/8
//	printf("%d\n", sizeof(a + 1));  //4/8
//	printf("%d\n", sizeof(a[1]));   //4/8
//	printf("%d\n", sizeof(&a));    //4/8
//	printf("%d\n", sizeof(*&a));   //16
//	printf("%d\n", sizeof(&a + 1));  //4/8
//	return 0;
//}


//int main()
//{
//	char arr[] = { 'a','b','c','d','e','f' };
//	printf("%d\n", sizeof(arr));  //6
//	printf("%d\n", sizeof(arr + 0));  //4
//	printf("%d\n", sizeof(*arr));  //1
//	printf("%d\n", sizeof(arr[1]));  //1
//	printf("%d\n", sizeof(&arr)); //4
//	printf("%d\n", sizeof(&arr + 1)); //4
//	printf("%d\n", sizeof(&arr[0] + 1));// 4
//	return 0;
//}


//int main()
//{
//	char arr[] = { 'a','b','c','d','e','f' };
//	printf("%d\n", strlen(arr));   //随机值
//	printf("%d\n", strlen(arr + 0));  //随机值
	//printf("%d\n", strlen(*arr));  //崩溃
	//printf("%d\n", strlen(arr[1]));   //崩溃
//	printf("%d\n", strlen(&arr));  //随机值
//	printf("%d\n", strlen(&arr + 1));  //随机值 - 6
//	printf("%d\n", strlen(&arr[0] + 1)); //随机值 - 1
//	return 0;
//}


//int main()
//{
//	char arr[] = "abcdef";
//	printf("%d\n", sizeof(arr)); //7
//	printf("%d\n", sizeof(arr + 0)); //4
//	printf("%d\n", sizeof(*arr)); //1
//	printf("%d\n", sizeof(arr[1])); //1
//	printf("%d\n", sizeof(&arr)); //4
//	printf("%d\n", sizeof(&arr + 1)); //4
//	printf("%d\n", sizeof(&arr[0] + 1)); //6
//	return 0;
//}


//int main()
//{
//	char arr[] = "abcdef";
//	printf("%d\n", strlen(arr));  //6
//	printf("%d\n", strlen(arr + 0)); //6
//	//printf("%d\n", strlen(*arr)); //break
//	//printf("%d\n", strlen(arr[1])); //break
//	printf("%d\n", strlen(&arr)); //6
//	printf("%d\n", strlen(&arr + 1)); //12
//	printf("%d\n", strlen(&arr[0] + 1)); //5 
//	return 0;
//}

//int main()
//{
//	char* p = "abcdef";
//	printf("%d\n", sizeof(p)); // 4
//	printf("%d\n", sizeof(p + 1)); //4
//	printf("%d\n", sizeof(*p)); //1
//	printf("%d\n", sizeof(p[0])); //1
//	printf("%d\n", sizeof(&p)); //4
//	printf("%d\n", sizeof(&p + 1)); //4
//	printf("%d\n", sizeof(&p[0] + 1)); //4
//	return 0;
//}

//int main()
//{
//	char* p = "abcdef";
//	printf("%d\n", strlen(p)); //6
//	printf("%d\n", strlen(p + 1)); //5
//	//printf("%d\n", strlen(*p)); //bk
//	//printf("%d\n", strlen(p[0])); //bk
//	printf("%d\n", strlen(&p)); //随机值
//	printf("%d\n", strlen(&p + 1)); //随机值 
//	printf("%d\n", strlen(&p[0] + 1));// 随机值 
//	return 0;
//}